/*
 * DISPLAY.h
 *
 * Created: 24.09.2012 14:52:09
 *  Author: mariuvi
 */ 


/*!
 * @header		DISPLAY.h
 * @discussion	This file contains all declarations for display handling
*/
#ifndef DISPLAY_H_
#define DISPLAY_H_

#include "CAN.h"
#include "definitions.h"

/*!
 * @function	DISPLAY_init
 * @discussion	Initializes the oled screen and wipes the virtual display
*/
void DISPLAY_init();


/*!
 * @function	DISPLAY_clear
 * @discussion	Clears the display, i.e. wiping the virtual display location in the memory
*/
void DISPLAY_clear();


/*!
 * @function	DISPLAY_print
 * @discussion	Prints the virtual display to the screen
*/
void DISPLAY_print();


/*!
 * @function	DISPLAY_move_marker
 * @discussion	Moves the marker up or down in the virtual display
 * @param		dir		The direction to move the marker
*/
void DISPLAY_move_marker(Direction dir);


/*!
 * @function	DISPLAY_move_menu
 * @discussion	Scrolls the menu
 * @param		str_above		String above the selected one
				str_selected	String selected
				str_below		String below the selected one
*/
void DISPLAY_move_menu(const char* str_above, const char* str_selected,const char* str_below);


/*!
 * @function	DISPLAY_write_line
 * @discussion	Writes the given string to the given position, with the option to clear the rest of the line
 * @param		str		String that is to be written
				row		The row in which to write the string
				col		The column in which to start writing the string
				clear	Boolean determining whether to clear the remainder of the line or not
*/
void DISPLAY_write_line(const char* str, int row, int col, int clear);


/*!
 * @function	DISPLAY_write_line_center
 * @discussion	Writes the given string centrated on the given row
 * @param		str		String that is to be written
 * @param		row		The row in which to write the string
*/
void DISPLAY_write_line_center(const char* str, int row);


/*!
 * @function	DISPLAY_int
 * @discussion	Writes the given int in the given position
 * @param		a		Int that is to be written
 * @param		row		The row in which to write the int
 * @param		col		The column in which to start writing the int
*/
void DISPLAY_int(int a, int row, int col);


/*!
 * @function	DISPLAY_play_board_init
 * @discussion	Initializes the display for playing.
*/
void DISPLAY_play_board_init();


/*!
 * @function	DISPLAY_playboard_uppdate.
 * @discussion	Updates the playboard, showing the correct score and lives.
 * @param		lives	Lives left.
 * @param		score	The current score.	
*/
void DISPLAY_playboard_update(uint8_t lives, uint8_t score);

#endif /* DISPLAY_H_ */